/*
 * FormatLength.cc
 *
 *  Created on: Mar 9, 2011
 *      Author: topcoder
 */

#include "FormatLength.h"

FormatLength::FormatLength(const LENGTH length): length_m(length)
{
}

ostream& FormatLength::outputFormatedLength(ostream& os)
{
    length_m.outputQuantityInXUnit(os,MILE);
    (length_m%LENGTH(1,MILE)).outputQuantityInXUnit(os,YARD);
    (length_m%LENGTH(1,YARD)).outputQuantityInXUnit(os,FEET);
    (length_m%LENGTH(1,FEET)).outputQuantityInXUnit(os,INCH);
    os << "\r\n";

    return os;
}

